package net.melon.article;

import java.io.File;
import java.util.NoSuchElementException;

public interface ArticleConstants {

	public static final String ARTICLE_CONTENT_SAVE_PATH = "melon.article.basic.save.path";
	
	public static final String ARTICLE_CONTENT_DOWNLOAD_URL = "melon.article.basic.download.url";
	
	public static final String ARTICLE_HTML_SAVE_PATH = "melon.article.html.save.path";
	
	public static final String ARTICLE_CONTENT_NEED_VERIFY = "melon.article.content.need.verify";
	
	public static final String ARTICLE_CONTENT_RICH_EDITOR_TOOLBARS = "melon.article.content.richeditor.toobars";
	
	static final String MELON_ARTICLE_HTML_PAGER_KEY = "melon.article.html.page.split.key";
	
	static final String MELON_ARTICLE_UPLOADER_KEY = "melon_article" + File.separator +"melon_article";
	
	static final String ARTICLE_DEFAULT_DIR = "melon_article";
	
	static final String ARTICLE_CONTENT_ICON_UPLOAD_KEY = "melon_article" + File.separator +"melon_article_icon";
	
	static final String ARTICLE_CONTENT_DIR = "_content";

	static final String ARTICLE_CHANNEL_ICON_DIR = "channel_icon";
	
	public static final String CONTENT_PAGE_SPLIT = "</page>";
	
	public static final String CONTENT_PAGE_POSTFIX = "html";
	
	public static final String ARTICLE_CHANNEL_STATE_ENUM_KEY ="article.channel.single.state.enum";//文章频道状态值的枚举关键字
	
	public static final String ARTICLE_CHANNEL_SHARE_STATE_ENUM_KEY = "article.channel.share.state";
	
	public static final String ARTICLE_CONTENT_SHARE_STATE_ENUM_KEY = "article.content.share.state";
	
	public static enum ContentState{
		UNVERIFY(0),PASS(1),UNPASS(-1),DELETED(-9);
		
		private int state;

		private ContentState(int state) {
			this.state = state;
		}

		public int getState() {
			return state;
		}
		
		public static ContentState valueOf(int state){
			for(ContentState cs : values()){
				if(cs.getState()==state){
					return cs;
				}
			}
			throw new NoSuchElementException("no such contenState for state:"+state);
		}
	}
	
	public static final String ArticleManage_SINGLETON_NAME = "melon.article.ArticleManage";
	public static final String ChannelManage_SINGLETON_NAME = "melon.article.ChannelManage";
	public static final String ArticleMObjectProvider_SINGLETON_NAME = "melon.article.ArticleMObjectProvider";
	public static final String ChannelMObjectProvider_SINGLETON_NAME = "melon.article.ChannelMObjectProvider";
}
